package com.ruleengine.worker.runner.rule.destination;

import com.ruleengine.util.model.Message;
import com.ruleengine.worker.model.Rule;
import com.ruleengine.worker.runner.rule.PubSubRuleRunner;

import io.vertx.core.Vertx;
import lombok.extern.slf4j.Slf4j;

/**
 * Only for test
 *
 * @author lianghanwei on 2024/3/29
 */
@Slf4j
public class BifromqRuleRunner extends PubSubRuleRunner<Message, Message> {
    // TODO-lhw-2024/03/29: 集成到 plugin，调整好根据 id 加载后，删除该类
    public BifromqRuleRunner(Vertx vertx, String name, Rule rule) {
        super(vertx, name, rule);
    }

    @Override
    public Message process(Message item) {
        return writeToBifroMQ(item);
    }

    private Message writeToBifroMQ(Message item) {
        log.info("writeToBifroMQ, item={}", new String(item.getMessage()));
        return null;
    }
}
